package com.itheima.eurekafeignclient.controller;


import cn.dm.pojo.User;
import com.itheima.eurekafeignclient.service.RefactorHelloService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class FeignController {

    @Autowired
    RefactorHelloService refactorHelloService;
    @GetMapping(value = "/feign-consumer")
    public String feignConsumer() {
        StringBuilder sb = new StringBuilder();
        sb.append(refactorHelloService.hello("黄幼彬")).append("<BR/>");
        sb.append(refactorHelloService.hello("hyb", 22)).append("<BR/>");
        sb.append(refactorHelloService.hello(new User("黄幼彬", 22))).append("<BR/>");
        sb.append(refactorHelloService.hello()).append("<BR/>");
        return sb.toString();
    }
    @GetMapping(value = "/hello5")
    public String hello5(){
        StringBuilder sb = new StringBuilder();
        sb.append(refactorHelloService.hello(new User("黄幼彬", 22))).append("<BR/>");
        return sb.toString();
    }
    @GetMapping(value = "/hello7")
    public String hello7(){
        StringBuilder sb = new StringBuilder();
        sb.append(refactorHelloService.hello()).append("<BR/>");
        return sb.toString();
    }

}
